package com.smarkparking.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.smarkparking.dao.UserDao;
import com.smarkparking.pojo.User;
import com.smarkparking.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 刘涛
 * @create 2021/11/17 14:41
 */
@Service
public class UserserviceImpl implements UserService {
    @Autowired
    private UserDao userDao;
    @Override
    public int addUser(User user) {
        int i = userDao.insert(user);
        return i;
    }

    @Override
    public User selectUserByEmail(String email) {
        QueryWrapper<User> uqw = new QueryWrapper<>();
        uqw.eq("email",email);
        User user = userDao.selectOne(uqw);
        return user;
    }
}
